// ----------------------------------
// RSDK Project: Sonic 1/Sonic 2
// Script Description: Edge Stabilizer Object
// Script Author: Christan Whitehead/Simon Thomley
// Unpacked by Rubberduckycooly's script unpacker
// ----------------------------------

//-------Aliases-------//
private alias 66 : TYPE_EDGESTABILIZER


// Static Values

// Tables

event ObjectMain
	foreach (GROUP_PLAYERS, currentPlayer, ACTIVE_ENTITIES)
		if object[currentPlayer].gravity == GRAVITY_GROUND
			BoxCollisionTest(C_TOUCH, object.entityPos, -8, -8, 8, 8, currentPlayer, HITBOX_AUTO, HITBOX_AUTO, HITBOX_AUTO, HITBOX_AUTO)
			if checkResult == 1
				temp0 = object[currentPlayer].collisionBottom
				temp0 *= -0x10000
				temp0 -= 0x80000
				temp0 += object.ypos
				if object[currentPlayer].ypos > temp0
					object[currentPlayer].ypos = temp0
				end if
			end if
		end if
	next
end event

event RSDKDraw
	DrawSprite(0)
end event

event RSDKLoad
	LoadSpriteSheet("Global/Display.gif")
	SpriteFrame(-16, -16, 32, 32, 1, 143)
end event
